﻿using CommunityToolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
using Telerik.Windows.Controls;

namespace Daq.Models
{
	public partial class ChannelModel : ObservableObject
    {
		[ObservableProperty]
		private string name;

        [ObservableProperty]
        private ChannelType type;

        [ObservableProperty]
        private double _value;

        [ObservableProperty]
        private double rangeMax;

        [ObservableProperty]
        private double rangeMin;

        [ObservableProperty]
        private string? unit;

        [ObservableProperty]
        private bool isEnabled;

        [ObservableProperty]
        private int index;

        [ObservableProperty]
        private DaqColor color;

        [ObservableProperty]
        private bool isChartVisible;

        [ObservableProperty]
        private double min;

        [ObservableProperty]
        private double max;

        //极差
        [ObservableProperty]
        private double range;

        public int Sum { get; set; }

        [ObservableProperty]
        private double average;

        [ObservableProperty]
        private int digits;

        [ObservableProperty]
        private bool isSummaryVisible;

        public void Reset()
        {
            Value = 0;
            Min = 0;
            Max = 0;
        }
    }
}
